﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Windows.Media.Imaging;
using OnlineGameLibrary.Contract;

namespace OnlineGameClient.View
{
    public partial class GameRoomsView : UserControl
    {
        public GameRoomsView()
        {
            InitializeComponent();
        }

        private void GroupStackPanel_Loaded(object sender, RoutedEventArgs e)
        {
            var groupstack = sender as StackPanel;
            var datacontext = groupstack.DataContext;
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void Image_Loaded(object sender, RoutedEventArgs e)
        {
            var image = sender as Image;
            var gameroom = image.DataContext as GameRoom;
            image.Source =
                new BitmapImage(
                    new Uri(new Uri(gameroom.GameInfo.GameClientComponentUri), "cover.png"));
        }
    }
}
